import request from '@/utils/request'
export default ({
    getList() {
        return request({
            url: '/person/doc/list',
            method: 'GET'
        })
    },
    getinfo(id) {
        return request({
            url: '/person/doc/info/' + id,
            method: 'POST'
        })
    },
    checkUsername(data) {
        return request({
            url: '/sys/company/userNameVer',
            method: 'post',
            params: {
                "userName": data
            }
        })
    },
    save(data) {
         let date=data.entryDate
         let str=date.toString().split('-')
         console.log(str)
         let year=str[0]
         let month=str[1]
         let day=str[2]
         let enterDate =year+'-'
         if(month<10) enterDate=enterDate+'0'+month
         else enterDate=enterDate+month
         if(day<10) enterDate=enterDate+'-0'+day
         else enterDate=enterDate+'-'+day
          data.entryDate=enterDate
        console.log('entryDate:'+data.entryDate)
        return request({
            url:'/person/doc/save',
            method:'post',
            params:data
        })
    },
    delete(data) {
        console.log(data)
        return request({
            url: '/person/doc/delete',
            method: 'post',
            params: {
                "ids": data
            }
        })
    },
    eveluate(data) {

        return request({
            url: '/person/evaluate',
            method: 'POST',
            params: data
        })
    }
})